<template>
  <view class="gui-bg-white gui-dark-bg-level-1 gui-padding ">
    <gui-search @inputting="inputting" @confirm="inputting" @clear="clear"></gui-search>
  </view>
  <view class="list">
    <navigator class="gui-list-items" v-for="item in list" key="item.id">
      <view class="gui-list-body gui-border-b">
        <text class="">{{item.name}}</text>
      </view>
    </navigator>
  </view>
</template>

<script>
  export default {
    data() {
      return {
        list: []
      }
    },
    onLoad() {
      this.getList()
    },
    methods: {
      async getList(e) {
        const res = await uni.gRequest.get('banquetname/list', {
          [e ? 'name' : '']: e || ''
        })
        // console.log(res);
        this.list = res.rows
      },
      inputting(e) {
        this.getList(e)
      },
      clear() {
        this.getList()
      }
    },

  }
</script>
<style scoped>
</style>
